/**
 * sequelize config
 * @type {*|Sequelize}
 */
const Sequelize = require('sequelize');
const sequelize = new Sequelize('fe', 'sharedaka_dev', 'Sharedaka8520', {
    host: 'rm-m5e406wz8143a82oz.mysql.rds.aliyuncs.com',
    dialect: 'mysql',
    pool: {
        max: 5,
        min: 0,
        acquire: 30000,
        idle: 10000
    },
    // 请参考 Querying - 查询 操作符 章节g
    operatorsAliases: false
});
sequelize
    .authenticate()
    .then(() =>{
        console.log('connect success');
    })
    .catch(err =>{
        console.log('unable connect database',err);
        process.exit();
    });
module.exports = sequelize;